home *** CD-ROM | disk | FTP | other *** search
/ Inter.Net 55-1 / Inter.Net 55-1.iso / CBuilder / Setup / BCB / data.z / dbtables.hpp < prev    next >
Encoding:
C/C++ Source or Header  |  1998-02-09  |  59.9 KB  |  1,422 lines

  1. // Borland C++ Builder
  2. // Copyright (c) 1995, 1998 by Borland International
  3. // All rights reserved
  4.  
  5. // (DO NOT EDIT: machine generated header) 'DBTables.pas' rev: 3.00
  6.  
  7. #ifndef DBTablesHPP
  8. #define DBTablesHPP
  9. #include <StdVCL.hpp>
  10. #include <SMIntf.hpp>
  11. #include <Bde.hpp>
  12. #include <DBCommon.hpp>
  13. #include <Db.hpp>
  14. #include <Controls.hpp>
  15. #include <Classes.hpp>
  16. #include <Graphics.hpp>
  17. #include <SysUtils.hpp>
  18. #include <Windows.hpp>
  19. #include <SysInit.hpp>
  20. #include <System.hpp>
  21.  
  22. //-- user supplied -----------------------------------------------------------
  23.  
  24. namespace Dbtables
  25. {
  26. //-- type declarations -------------------------------------------------------
  27. typedef Bde::FLDDesc TFieldDescList[1024];
  28.  
  29. typedef TFieldDescList *PFieldDescList;
  30.  
  31. typedef Bde::IDXDesc TIndexDescList[64];
  32.  
  33. typedef TIndexDescList *PIndexDescList;
  34.  
  35. typedef Bde::SPParamDesc TSPParamDescList[1024];
  36.  
  37. typedef TSPParamDescList *PSPParamDescList;
  38.  
  39. class DELPHICLASS EDBEngineError;
  40. class DELPHICLASS TDBError;
  41. class PASCALIMPLEMENTATION EDBEngineError : public Db::EDatabaseError 
  42. {
  43.     typedef Db::EDatabaseError inherited;
  44.     
  45. private:
  46.     Classes::TList* FErrors;
  47.     TDBError* __fastcall GetError(int Index);
  48.     int __fastcall GetErrorCount(void);
  49.     
  50. public:
  51.     __fastcall EDBEngineError(Word ErrorCode);
  52.     __fastcall virtual ~EDBEngineError(void);
  53.     __property int ErrorCount = {read=GetErrorCount, nodefault};
  54.     __property TDBError* Errors[int Index] = {read=GetError};
  55. public:
  56.     /* Exception.CreateFmt */ __fastcall EDBEngineError(const System::AnsiString Msg, const System::TVarRec 
  57.         * Args, const int Args_Size) : Db::EDatabaseError(Msg, Args, Args_Size) { }
  58.     /* Exception.CreateRes */ __fastcall EDBEngineError(int Ident, Extended Dummy) : Db::EDatabaseError(
  59.         Ident, Dummy) { }
  60.     /* Exception.CreateResFmt */ __fastcall EDBEngineError(int Ident, const System::TVarRec * Args, const 
  61.         int Args_Size) : Db::EDatabaseError(Ident, Args, Args_Size) { }
  62.     /* Exception.CreateHelp */ __fastcall EDBEngineError(const System::AnsiString Msg, int AHelpContext
  63.         ) : Db::EDatabaseError(Msg, AHelpContext) { }
  64.     /* Exception.CreateFmtHelp */ __fastcall EDBEngineError(const System::AnsiString Msg, const System::TVarRec 
  65.         * Args, const int Args_Size, int AHelpContext) : Db::EDatabaseError(Msg, Args, Args_Size, AHelpContext
  66.         ) { }
  67.     /* Exception.CreateResHelp */ __fastcall EDBEngineError(int Ident, int AHelpContext) : Db::EDatabaseError(
  68.         Ident, AHelpContext) { }
  69.     /* Exception.CreateResFmtHelp */ __fastcall EDBEngineError(int Ident, const System::TVarRec * Args, 
  70.         const int Args_Size, int AHelpContext) : Db::EDatabaseError(Ident, Args, Args_Size, AHelpContext) { }
  71.         
  72.     
  73. };
  74.  
  75. class DELPHICLASS ENoResultSet;
  76. class PASCALIMPLEMENTATION ENoResultSet : public Db::EDatabaseError 
  77. {
  78.     typedef Db::EDatabaseError inherited;
  79.     
  80. public:
  81.     /* Exception.Create */ __fastcall ENoResultSet(const System::AnsiString Msg) : Db::EDatabaseError(Msg
  82.         ) { }
  83.     /* Exception.CreateFmt */ __fastcall ENoResultSet(const System::AnsiString Msg, const System::TVarRec 
  84.         * Args, const int Args_Size) : Db::EDatabaseError(Msg, Args, Args_Size) { }
  85.     /* Exception.CreateRes */ __fastcall ENoResultSet(int Ident, Extended Dummy) : Db::EDatabaseError(Ident
  86.         , Dummy) { }
  87.     /* Exception.CreateResFmt */ __fastcall ENoResultSet(int Ident, const System::TVarRec * Args, const 
  88.         int Args_Size) : Db::EDatabaseError(Ident, Args, Args_Size) { }
  89.     /* Exception.CreateHelp */ __fastcall ENoResultSet(const System::AnsiString Msg, int AHelpContext) : 
  90.         Db::EDatabaseError(Msg, AHelpContext) { }
  91.     /* Exception.CreateFmtHelp */ __fastcall ENoResultSet(const System::AnsiString Msg, const System::TVarRec 
  92.         * Args, const int Args_Size, int AHelpContext) : Db::EDatabaseError(Msg, Args, Args_Size, AHelpContext
  93.         ) { }
  94.     /* Exception.CreateResHelp */ __fastcall ENoResultSet(int Ident, int AHelpContext) : Db::EDatabaseError(
  95.         Ident, AHelpContext) { }
  96.     /* Exception.CreateResFmtHelp */ __fastcall ENoResultSet(int Ident, const System::TVarRec * Args, const 
  97.         int Args_Size, int AHelpContext) : Db::EDatabaseError(Ident, Args, Args_Size, AHelpContext) { }
  98.     
  99. public:
  100.     /* TObject.Destroy */ __fastcall virtual ~ENoResultSet(void) { }
  101.     
  102. };
  103.  
  104. class PASCALIMPLEMENTATION TDBError : public System::TObject 
  105. {
  106.     typedef System::TObject inherited;
  107.     
  108. private:
  109.     Word FErrorCode;
  110.     int FNativeError;
  111.     System::AnsiString FMessage;
  112.     Byte __fastcall GetCategory(void);
  113.     Byte __fastcall GetSubCode(void);
  114.     
  115. public:
  116.     __fastcall TDBError(EDBEngineError* Owner, Word ErrorCode, int NativeError, char * Message);
  117.     __property Byte Category = {read=GetCategory, nodefault};
  118.     __property Word ErrorCode = {read=FErrorCode, nodefault};
  119.     __property Byte SubCode = {read=GetSubCode, nodefault};
  120.     __property System::AnsiString Message = {read=FMessage};
  121.     __property int NativeError = {read=FNativeError, nodefault};
  122. public:
  123.     /* TObject.Destroy */ __fastcall virtual ~TDBError(void) { }
  124.     
  125. };
  126.  
  127. typedef void *TLocale;
  128.  
  129. typedef Bde::CBRType __fastcall (__closure *TBDECallbackEvent)(void * CBInfo);
  130.  
  131. class DELPHICLASS TBDECallback;
  132. class PASCALIMPLEMENTATION TBDECallback : public System::TObject 
  133. {
  134.     typedef System::TObject inherited;
  135.     
  136. private:
  137.     Bde::_hDBIObj *FHandle;
  138.     System::TObject* FOwner;
  139.     CBType FCBType;
  140.     int FOldCBData;
  141.     void *FOldCBBuf;
  142.     Word FOldCBBufLen;
  143.     Bde::pfDBICallBack FOldCBFunc;
  144.     bool FInstalled;
  145.     TBDECallbackEvent FCallbackEvent;
  146.     
  147. protected:
  148.     Bde::CBRType __fastcall Invoke(Bde::CBType CallType, void * CBInfo);
  149.     
  150. public:
  151.     __fastcall TBDECallback(System::TObject* AOwner, Bde::hDBICur Handle, Bde::CBType CBType, void * CBBuf
  152.         , int CBBufSize, TBDECallbackEvent CallbackEvent, bool Chain);
  153.     __fastcall virtual ~TBDECallback(void);
  154. };
  155.  
  156. class DELPHICLASS TSessionList;
  157. class DELPHICLASS TSession;
  158. class PASCALIMPLEMENTATION TSessionList : public System::TObject 
  159. {
  160.     typedef System::TObject inherited;
  161.     
  162. private:
  163.     Classes::TList* FSessions;
  164.     Classes::TBits* FSessionNumbers;
  165.     void __fastcall AddSession(TSession* ASession);
  166.     void __fastcall CloseAll(void);
  167.     int __fastcall GetCount(void);
  168.     TSession* __fastcall GetSession(int Index);
  169.     TSession* __fastcall GetCurrentSession(void);
  170.     TSession* __fastcall GetSessionByName(const System::AnsiString SessionName);
  171.     void __fastcall SetCurrentSession(TSession* Value);
  172.     
  173. public:
  174.     __fastcall TSessionList(void);
  175.     __fastcall virtual ~TSessionList(void);
  176.     __property TSession* CurrentSession = {read=GetCurrentSession, write=SetCurrentSession};
  177.     TSession* __fastcall FindSession(const System::AnsiString SessionName);
  178.     void __fastcall GetSessionNames(Classes::TStrings* List);
  179.     TSession* __fastcall OpenSession(const System::AnsiString SessionName);
  180.     __property int Count = {read=GetCount, nodefault};
  181.     __property TSession* Sessions[int Index] = {read=GetSession/*, default*/};
  182.     __property TSession* List[System::AnsiString SessionName] = {read=GetSessionByName};
  183. };
  184.  
  185. enum TConfigModes { cfmVirtual, cfmPersistent, cfmSession };
  186.  
  187. typedef Set<TConfigModes, cfmVirtual, cfmSession>  TConfigMode;
  188.  
  189. typedef void __fastcall (__closure *TPasswordEvent)(System::TObject* Sender, bool &Continue);
  190.  
  191. enum TDatabaseEvent { dbOpen, dbClose, dbAdd, dbRemove, dbAddAlias, dbDeleteAlias, dbAddDriver, dbDeleteDriver 
  192.     };
  193.  
  194. typedef void __fastcall (__closure *TDatabaseNotifyEvent)(TDatabaseEvent DBEvent, const void *Param)
  195.     ;
  196.  
  197. typedef void __fastcall (*TBDEInitProc)(TSession* Session);
  198.  
  199. enum TTraceFlag { tfQPrepare, tfQExecute, tfError, tfStmt, tfConnect, tfTransact, tfBlob, tfMisc, tfVendor, 
  200.     tfDataIn, tfDataOut };
  201.  
  202. typedef Set<TTraceFlag, tfQPrepare, tfDataOut>  TTraceFlags;
  203.  
  204. class DELPHICLASS TDatabase;
  205. class PASCALIMPLEMENTATION TSession : public Classes::TComponent 
  206. {
  207.     typedef Classes::TComponent inherited;
  208.     
  209. private:
  210.     Bde::_hDBIObj *FHandle;
  211.     Classes::TList* FDatabases;
  212.     Classes::TList* FCallbacks;
  213.     void *FLocale;
  214.     Smintf::_di_ISMClient FSMClient;
  215.     Bde::TRACEDesc *FSMBuffer;
  216.     TTraceFlags FTraceFlags;
  217.     bool FSMLoadFailed;
  218.     bool FStreamedActive;
  219.     bool FKeepConnections;
  220.     bool FDefault;
  221.     bool FSQLHourGlass;
  222.     bool FAutoSessionName;
  223.     bool FUpdatingAutoSessionName;
  224.     bool FDLLDetach;
  225.     bool FBDEOwnsLoginCbDb;
  226.     System::AnsiString FSessionName;
  227.     int FSessionNumber;
  228.     System::AnsiString FNetFileDir;
  229.     System::AnsiString FPrivateDir;
  230.     CBSCType FCBSCType;
  231.     int FLockCount;
  232.     int FReserved;
  233.     Bde::TCBDBLogin FCBDBLogin;
  234.     TPasswordEvent FOnPassword;
  235.     Classes::TNotifyEvent FOnStartup;
  236.     TDatabaseNotifyEvent FOnDBNotify;
  237.     void __fastcall AddDatabase(TDatabase* Value);
  238.     void __fastcall CallBDEInitProcs(void);
  239.     void __fastcall CheckInactive(void);
  240.     void __fastcall CheckConfigMode(TConfigMode CfgMode);
  241.     void __fastcall CloseDatabaseHandle(TDatabase* Database);
  242.     Bde::CBRType __fastcall DBLoginCallback(void * CBInfo);
  243.     void __fastcall DBNotification(TDatabaseEvent DBEvent, const void *Param);
  244.     void __fastcall DeleteConfigPath(const System::AnsiString Path, const System::AnsiString Node);
  245.     TDatabase* __fastcall DoFindDatabase(const System::AnsiString DatabaseName, Classes::TComponent* AOwner
  246.         );
  247.     TDatabase* __fastcall DoOpenDatabase(const System::AnsiString DatabaseName, Classes::TComponent* AOwner
  248.         );
  249.     Bde::hDBIDb __fastcall FindDatabaseHandle(const System::AnsiString DatabaseName);
  250.     bool __fastcall GetActive(void);
  251.     TConfigMode __fastcall GetConfigMode(void);
  252.     TDatabase* __fastcall GetDatabase(int Index);
  253.     int __fastcall GetDatabaseCount(void);
  254.     Bde::hDBISes __fastcall GetHandle(void);
  255.     System::AnsiString __fastcall GetNetFileDir(void);
  256.     System::AnsiString __fastcall GetPrivateDir(void);
  257.     void __fastcall InitializeBDE(void);
  258.     void __fastcall InternalAddAlias(const System::AnsiString Name, const System::AnsiString Driver, Classes::TStrings* 
  259.         List, TConfigMode CfgMode, bool RestoreMode);
  260.     void __fastcall InternalDeleteAlias(const System::AnsiString Name, TConfigMode CfgMode, bool RestoreMode
  261.         );
  262.     bool __fastcall SessionNameStored(void);
  263.     void __fastcall LoadSMClient(bool DesignTime);
  264.     void __fastcall LockSession(void);
  265.     void __fastcall MakeCurrent(void);
  266.     void __fastcall RegisterCallbacks(bool Value);
  267.     void __fastcall RemoveDatabase(TDatabase* Value);
  268.     Bde::CBRType __fastcall ServerCallback(void * CBInfo);
  269.     void __fastcall SetActive(bool Value);
  270.     void __fastcall SetAutoSessionName(bool Value);
  271.     void __fastcall SetConfigMode(TConfigMode Value);
  272.     void __fastcall SetConfigParams(const System::AnsiString Path, const System::AnsiString Node, Classes::TStrings* 
  273.         List);
  274.     void __fastcall SetNetFileDir(const System::AnsiString Value);
  275.     void __fastcall SetPrivateDir(const System::AnsiString Value);
  276.     void __fastcall SetSessionName(const System::AnsiString Value);
  277.     void __fastcall SetSessionNames(void);
  278.     void __fastcall SetTraceFlags(TTraceFlags Value);
  279.     void __fastcall SMClientSignal(System::TObject* Sender, int Data);
  280.     Bde::CBRType __fastcall SqlTraceCallback(void * CBInfo);
  281.     void __fastcall StartSession(bool Value);
  282.     void __fastcall UnlockSession(void);
  283.     void __fastcall UpdateAutoSessionName(void);
  284.     void __fastcall ValidateAutoSession(Classes::TComponent* AOwner, bool AllSessions);
  285.     
  286. protected:
  287.     virtual void __fastcall Loaded(void);
  288.     void __fastcall ModifyConfigParams(const System::AnsiString Path, const System::AnsiString Node, Classes::TStrings* 
  289.         List);
  290.     virtual void __fastcall Notification(Classes::TComponent* AComponent, Classes::TOperation Operation
  291.         );
  292.     __property TDatabaseNotifyEvent OnDBNotify = {read=FOnDBNotify, write=FOnDBNotify};
  293.     __property bool BDEOwnsLoginCbDb = {read=FBDEOwnsLoginCbDb, write=FBDEOwnsLoginCbDb, nodefault};
  294.     virtual void __fastcall SetName(const System::AnsiString NewName);
  295.     
  296. public:
  297.     __fastcall virtual TSession(Classes::TComponent* AOwner);
  298.     __fastcall virtual ~TSession(void);
  299.     void __fastcall AddAlias(const System::AnsiString Name, const System::AnsiString Driver, Classes::TStrings* 
  300.         List);
  301.     void __fastcall AddDriver(const System::AnsiString Name, Classes::TStrings* List);
  302.     void __fastcall AddStandardAlias(const System::AnsiString Name, const System::AnsiString Path, const 
  303.         System::AnsiString DefaultDriver);
  304.     __property TConfigMode ConfigMode = {read=GetConfigMode, write=SetConfigMode, nodefault};
  305.     void __fastcall AddPassword(const System::AnsiString Password);
  306.     void __fastcall Close(void);
  307.     void __fastcall CloseDatabase(TDatabase* Database);
  308.     void __fastcall DeleteAlias(const System::AnsiString Name);
  309.     void __fastcall DeleteDriver(const System::AnsiString Name);
  310.     void __fastcall DropConnections(void);
  311.     TDatabase* __fastcall FindDatabase(const System::AnsiString DatabaseName);
  312.     void __fastcall GetAliasNames(Classes::TStrings* List);
  313.     void __fastcall GetAliasParams(const System::AnsiString AliasName, Classes::TStrings* List);
  314.     System::AnsiString __fastcall GetAliasDriverName(const System::AnsiString AliasName);
  315.     void __fastcall GetConfigParams(const System::AnsiString Path, const System::AnsiString Section, Classes::TStrings* 
  316.         List);
  317.     void __fastcall GetDatabaseNames(Classes::TStrings* List);
  318.     void __fastcall GetDriverNames(Classes::TStrings* List);
  319.     void __fastcall GetDriverParams(const System::AnsiString DriverName, Classes::TStrings* List);
  320.     bool __fastcall GetPassword(void);
  321.     void __fastcall GetTableNames(const System::AnsiString DatabaseName, const System::AnsiString Pattern
  322.         , bool Extensions, bool SystemTables, Classes::TStrings* List);
  323.     void __fastcall GetStoredProcNames(const System::AnsiString DatabaseName, Classes::TStrings* List);
  324.         
  325.     bool __fastcall IsAlias(const System::AnsiString Name);
  326.     void __fastcall ModifyAlias(System::AnsiString Name, Classes::TStrings* List);
  327.     void __fastcall ModifyDriver(System::AnsiString Name, Classes::TStrings* List);
  328.     void __fastcall Open(void);
  329.     TDatabase* __fastcall OpenDatabase(const System::AnsiString DatabaseName);
  330.     void __fastcall RemoveAllPasswords(void);
  331.     void __fastcall RemovePassword(const System::AnsiString Password);
  332.     void __fastcall SaveConfigFile(void);
  333.     __property int DatabaseCount = {read=GetDatabaseCount, nodefault};
  334.     __property TDatabase* Databases[int Index] = {read=GetDatabase};
  335.     __property Bde::hDBISes Handle = {read=GetHandle};
  336.     __property void * Locale = {read=FLocale};
  337.     __property TTraceFlags TraceFlags = {read=FTraceFlags, write=SetTraceFlags, nodefault};
  338.     
  339. __published:
  340.     __property bool Active = {read=GetActive, write=SetActive, default=0};
  341.     __property bool AutoSessionName = {read=FAutoSessionName, write=SetAutoSessionName, default=0};
  342.     __property bool KeepConnections = {read=FKeepConnections, write=FKeepConnections, default=1};
  343.     __property System::AnsiString NetFileDir = {read=GetNetFileDir, write=SetNetFileDir};
  344.     __property System::AnsiString PrivateDir = {read=GetPrivateDir, write=SetPrivateDir};
  345.     __property System::AnsiString SessionName = {read=FSessionName, write=SetSessionName, stored=SessionNameStored
  346.         };
  347.     __property bool SQLHourGlass = {read=FSQLHourGlass, write=FSQLHourGlass, default=1};
  348.     __property TPasswordEvent OnPassword = {read=FOnPassword, write=FOnPassword};
  349.     __property Classes::TNotifyEvent OnStartup = {read=FOnStartup, write=FOnStartup};
  350. };
  351.  
  352. class DELPHICLASS TParamList;
  353. class PASCALIMPLEMENTATION TParamList : public System::TObject 
  354. {
  355.     typedef System::TObject inherited;
  356.     
  357. private:
  358.     int FFieldCount;
  359.     Word FBufSize;
  360.     TFieldDescList *FFieldDescs;
  361.     char *FBuffer;
  362.     
  363. public:
  364.     __fastcall TParamList(Classes::TStrings* Params);
  365.     __fastcall virtual ~TParamList(void);
  366.     __property char * Buffer = {read=FBuffer};
  367.     __property int FieldCount = {read=FFieldCount, nodefault};
  368.     __property PFieldDescList FieldDescs = {read=FFieldDescs};
  369. };
  370.  
  371. enum TTransIsolation { tiDirtyRead, tiReadCommitted, tiRepeatableRead };
  372.  
  373. typedef void __fastcall (__closure *TLoginEvent)(TDatabase* Database, Classes::TStrings* LoginParams
  374.     );
  375.  
  376. class DELPHICLASS TDBDataSet;
  377. class PASCALIMPLEMENTATION TDatabase : public Classes::TComponent 
  378. {
  379.     typedef Classes::TComponent inherited;
  380.     
  381. private:
  382.     Classes::TList* FDataSets;
  383.     TTransIsolation FTransIsolation;
  384.     bool FLoginPrompt;
  385.     bool FKeepConnection;
  386.     bool FTemporary;
  387.     bool FSessionAlias;
  388.     bool FStreamedConnected;
  389.     bool FLocaleLoaded;
  390.     bool FAliased;
  391.     bool FSQLBased;
  392.     bool FAcquiredHandle;
  393.     bool FPseudoIndexes;
  394.     bool FHandleShared;
  395.     int FRefCount;
  396.     Bde::_hDBIObj *FHandle;
  397.     void *FLocale;
  398.     TSession* FSession;
  399.     Classes::TStrings* FParams;
  400.     System::AnsiString FSessionName;
  401.     System::AnsiString FDatabaseName;
  402.     System::AnsiString FDatabaseType;
  403.     TLoginEvent FOnLogin;
  404.     void __fastcall CheckActive(void);
  405.     void __fastcall CheckInactive(void);
  406.     void __fastcall CheckDatabaseName(void);
  407.     void __fastcall CheckDatabaseAlias(System::AnsiString &Password);
  408.     void __fastcall CheckSessionName(bool Required);
  409.     void __fastcall EndTransaction(Bde::eXEnd TransEnd);
  410.     System::AnsiString __fastcall GetAliasName(void);
  411.     bool __fastcall GetConnected(void);
  412.     TDBDataSet* __fastcall GetDataSet(int Index);
  413.     int __fastcall GetDataSetCount(void);
  414.     System::AnsiString __fastcall GetDirectory(void);
  415.     System::AnsiString __fastcall GetDriverName(void);
  416.     bool __fastcall GetInTransaction(void);
  417.     TTraceFlags __fastcall GetTraceFlags(void);
  418.     void __fastcall LoadLocale(void);
  419.     void __fastcall Login(Classes::TStrings* LoginParams);
  420.     bool __fastcall OpenFromExistingDB(void);
  421.     void __fastcall ParamsChanging(System::TObject* Sender);
  422.     void __fastcall SetAliasName(const System::AnsiString Value);
  423.     void __fastcall SetConnected(bool Value);
  424.     void __fastcall SetDatabaseFlags(void);
  425.     void __fastcall SetDatabaseName(const System::AnsiString Value);
  426.     void __fastcall SetDatabaseType(const System::AnsiString Value, bool Aliased);
  427.     void __fastcall SetDirectory(const System::AnsiString Value);
  428.     void __fastcall SetDriverName(const System::AnsiString Value);
  429.     void __fastcall SetHandle(Bde::hDBIDb Value);
  430.     void __fastcall SetKeepConnection(bool Value);
  431.     void __fastcall SetParams(Classes::TStrings* Value);
  432.     void __fastcall SetTraceFlags(TTraceFlags Value);
  433.     void __fastcall SetSessionName(const System::AnsiString Value);
  434.     
  435. protected:
  436.     virtual void __fastcall Loaded(void);
  437.     virtual void __fastcall Notification(Classes::TComponent* AComponent, Classes::TOperation Operation
  438.         );
  439.     
  440. public:
  441.     __fastcall virtual TDatabase(Classes::TComponent* AOwner);
  442.     __fastcall virtual ~TDatabase(void);
  443.     void __fastcall ApplyUpdates(TDBDataSet* const * DataSets, const int DataSets_Size);
  444.     void __fastcall Close(void);
  445.     void __fastcall CloseDataSets(void);
  446.     void __fastcall Commit(void);
  447.     void __fastcall FlushSchemaCache(const System::AnsiString TableName);
  448.     void __fastcall Open(void);
  449.     void __fastcall Rollback(void);
  450.     void __fastcall StartTransaction(void);
  451.     void __fastcall ValidateName(const System::AnsiString Name);
  452.     __property int DataSetCount = {read=GetDataSetCount, nodefault};
  453.     __property TDBDataSet* DataSets[int Index] = {read=GetDataSet};
  454.     __property System::AnsiString Directory = {read=GetDirectory, write=SetDirectory};
  455.     __property Bde::hDBIDb Handle = {read=FHandle, write=SetHandle};
  456.     __property bool IsSQLBased = {read=FSQLBased, nodefault};
  457.     __property bool InTransaction = {read=GetInTransaction, nodefault};
  458.     __property void * Locale = {read=FLocale};
  459.     __property TSession* Session = {read=FSession};
  460.     __property bool Temporary = {read=FTemporary, write=FTemporary, nodefault};
  461.     __property bool SessionAlias = {read=FSessionAlias, nodefault};
  462.     __property TTraceFlags TraceFlags = {read=GetTraceFlags, write=SetTraceFlags, nodefault};
  463.     
  464. __published:
  465.     __property System::AnsiString AliasName = {read=GetAliasName, write=SetAliasName};
  466.     __property bool Connected = {read=GetConnected, write=SetConnected, default=0};
  467.     __property System::AnsiString DatabaseName = {read=FDatabaseName, write=SetDatabaseName};
  468.     __property System::AnsiString DriverName = {read=GetDriverName, write=SetDriverName};
  469.     __property bool HandleShared = {read=FHandleShared, write=FHandleShared, default=0};
  470.     __property bool KeepConnection = {read=FKeepConnection, write=SetKeepConnection, default=1};
  471.     __property bool LoginPrompt = {read=FLoginPrompt, write=FLoginPrompt, default=1};
  472.     __property Classes::TStrings* Params = {read=FParams, write=SetParams};
  473.     __property System::AnsiString SessionName = {read=FSessionName, write=SetSessionName};
  474.     __property TTransIsolation TransIsolation = {read=FTransIsolation, write=FTransIsolation, default=1
  475.         };
  476.     __property TLoginEvent OnLogin = {read=FOnLogin, write=FOnLogin};
  477. };
  478.  
  479. enum TRecNoStatus { rnDbase, rnParadox, rnNotSupported };
  480.  
  481. enum TUpdateAction { uaFail, uaAbort, uaSkip, uaRetry, uaApplied };
  482.  
  483. enum DBTables__9 { rtModified, rtInserted, rtDeleted, rtUnmodified };
  484.  
  485. typedef Set<DBTables__9, rtModified, rtUnmodified>  TUpdateRecordTypes;
  486.  
  487. typedef void __fastcall (__closure *TUpdateErrorEvent)(Db::TDataSet* DataSet, Db::EDatabaseError* E, 
  488.     Db::TUpdateKind UpdateKind, TUpdateAction &UpdateAction);
  489.  
  490. typedef void __fastcall (__closure *TUpdateRecordEvent)(Db::TDataSet* DataSet, Db::TUpdateKind UpdateKind
  491.     , TUpdateAction &UpdateAction);
  492.  
  493. typedef void __fastcall (__closure *TOnServerYieldEvent)(Db::TDataSet* DataSet, bool &AbortQuery);
  494.  
  495. class DELPHICLASS TDataSetUpdateObject;
  496. class DELPHICLASS TBDEDataSet;
  497. class PASCALIMPLEMENTATION TDataSetUpdateObject : public Classes::TComponent 
  498. {
  499.     typedef Classes::TComponent inherited;
  500.     
  501. protected:
  502.     virtual TBDEDataSet* __fastcall GetDataSet(void) = 0;
  503.     virtual void __fastcall SetDataSet(TBDEDataSet* ADataSet) = 0;
  504.     virtual void __fastcall Apply(Db::TUpdateKind UpdateKind) = 0;
  505.     __property TBDEDataSet* DataSet = {read=GetDataSet, write=SetDataSet};
  506. public:
  507.     /* TComponent.Create */ __fastcall virtual TDataSetUpdateObject(Classes::TComponent* AOwner) : Classes::
  508.         TComponent(AOwner) { }
  509.     /* TComponent.Destroy */ __fastcall virtual ~TDataSetUpdateObject(void) { }
  510.     
  511. };
  512.  
  513. enum TKeyIndex { kiLookup, kiRangeStart, kiRangeEnd, kiCurRangeStart, kiCurRangeEnd, kiSave };
  514.  
  515. struct TKeyBuffer;
  516. typedef TKeyBuffer *PKeyBuffer;
  517.  
  518. #pragma pack(push, 1)
  519. struct DBTables__11
  520. {
  521.     
  522. } ;
  523. #pragma pack(pop)
  524.  
  525. struct TKeyBuffer
  526. {
  527.     bool Modified;
  528.     bool Exclusive;
  529.     int FieldCount;
  530.     DBTables__11 Data;
  531. } ;
  532.  
  533. struct TRecInfo;
  534. typedef TRecInfo *PRecInfo;
  535.  
  536. struct TRecInfo
  537. {
  538.     int RecordNumber;
  539.     TUpdateStatus UpdateStatus;
  540.     TBookmarkFlag BookmarkFlag;
  541. } ;
  542.  
  543. typedef System::AnsiString TBlobData;
  544.  
  545. typedef System::AnsiString TBlobDataArray[1];
  546.  
  547. typedef TBlobDataArray *PBlobDataArray;
  548.  
  549. class PASCALIMPLEMENTATION TBDEDataSet : public Db::TDataSet 
  550. {
  551.     typedef Db::TDataSet inherited;
  552.     
  553. private:
  554.     Bde::_hDBIObj *FHandle;
  555.     Bde::RECProps FRecProps;
  556.     void *FLocale;
  557.     Bde::_hDBIObj *FExprFilter;
  558.     Bde::_hDBIObj *FFuncFilter;
  559.     char *FFilterBuffer;
  560.     Word FIndexFieldMap[16];
  561.     bool FExpIndex;
  562.     bool FCaseInsIndex;
  563.     bool FCachedUpdates;
  564.     bool FInUpdateCallback;
  565.     bool FCanModify;
  566.     bool FCacheBlobs;
  567.     Word FKeySize;
  568.     Bde::DELAYUPDCbDesc *FUpdateCBBuf;
  569.     TBDECallback* FUpdateCallback;
  570.     TBDECallback* FAsyncCallback;
  571.     CBYieldStep FCBYieldStep;
  572.     TKeyBuffer *FKeyBuffers[6];
  573.     TKeyBuffer *FKeyBuffer;
  574.     TRecNoStatus FRecNoStatus;
  575.     int FIndexFieldCount;
  576.     int FConstDisableCount;
  577.     Word FRecordSize;
  578.     Word FBookmarkOfs;
  579.     Word FRecInfoOfs;
  580.     Word FBlobCacheOfs;
  581.     Word FRecBufSize;
  582.     bool FConstraintLayer;
  583.     Stdvcl::_di_IProvider FProvIntf;
  584.     TOnServerYieldEvent FOnServerYield;
  585.     TDataSetUpdateObject* FUpdateObject;
  586.     TUpdateErrorEvent FOnUpdateError;
  587.     TUpdateRecordEvent FOnUpdateRecord;
  588.     void __fastcall ClearBlobCache(char * Buffer);
  589.     bool __fastcall GetActiveRecBuf(char * &RecBuf);
  590.     System::AnsiString __fastcall GetBlobData(Db::TField* Field, char * Buffer);
  591.     char * __fastcall GetOldRecord(void);
  592.     void __fastcall InitBufferPointers(bool GetProps);
  593.     short __stdcall RecordFilter(void * RecBuf, int RecNo);
  594.     void __fastcall SetBlobData(Db::TField* Field, char * Buffer, System::AnsiString Value);
  595.     bool __fastcall HasConstraints(void);
  596.     
  597. protected:
  598.     void __fastcall ActivateFilters(void);
  599.     void __fastcall AddFieldDesc(const Bde::FLDDesc &FieldDesc, bool ARequired);
  600.     void __fastcall AllocCachedUpdateBuffers(bool Allocate);
  601.     void __fastcall AllocKeyBuffers(void);
  602.     virtual char * __fastcall AllocRecordBuffer(void);
  603.     virtual bool __fastcall BCDToCurr(void * BCD, System::Currency &Curr);
  604.     virtual bool __fastcall CurrToBCD(const System::Currency Curr, void * BCD, int Precision, int Decimals
  605.         );
  606.     Bde::CBRType __fastcall CachedUpdateCallBack(void * CBInfo);
  607.     void __fastcall CheckCachedUpdateMode(void);
  608.     void __fastcall CheckSetKeyMode(void);
  609.     virtual void __fastcall ClearCalcFields(char * Buffer);
  610.     virtual void __fastcall CloseCursor(void);
  611.     virtual void __fastcall CloseBlob(Db::TField* Field);
  612.     Bde::hDBIFilter __fastcall CreateExprFilter(const System::AnsiString Expr, Db::TFilterOptions Options
  613.         , int Priority);
  614.     Bde::hDBIFilter __fastcall CreateFuncFilter(void * FilterFunc, int Priority);
  615.     virtual Bde::hDBICur __fastcall CreateHandle(void);
  616.     Bde::hDBIFilter __fastcall CreateLookupFilter(Classes::TList* Fields, const System::Variant &Values
  617.         , Db::TLocateOptions Options, int Priority);
  618.     void __fastcall DeactivateFilters(void);
  619.     virtual void __fastcall DestroyHandle(void);
  620.     virtual void __fastcall DestroyLookupCursor(void);
  621.     virtual bool __fastcall FindRecord(bool Restart, bool GoForward);
  622.     bool __fastcall ForceUpdateCallback(void);
  623.     void __fastcall FreeKeyBuffers(void);
  624.     virtual void __fastcall FreeRecordBuffer(char * &Buffer);
  625.     virtual void __fastcall GetBookmarkData(char * Buffer, void * Data);
  626.     virtual Db::TBookmarkFlag __fastcall GetBookmarkFlag(char * Buffer);
  627.     virtual bool __fastcall GetCanModify(void);
  628.     virtual bool __fastcall GetFieldData(Db::TField* Field, void * Buffer);
  629.     Db::TField* __fastcall GetIndexField(int Index);
  630.     int __fastcall GetIndexFieldCount(void);
  631.     virtual bool __fastcall GetIsIndexField(Db::TField* Field);
  632.     PKeyBuffer __fastcall GetKeyBuffer(TKeyIndex KeyIndex);
  633.     bool __fastcall GetKeyExclusive(void);
  634.     int __fastcall GetKeyFieldCount(void);
  635.     virtual Bde::hDBICur __fastcall GetLookupCursor(const System::AnsiString KeyFields, bool CaseInsensitive
  636.         );
  637.     virtual Db::TGetResult __fastcall GetRecord(char * Buffer, Db::TGetMode GetMode, bool DoCheck);
  638.     virtual int __fastcall GetRecordCount(void);
  639.     virtual int __fastcall GetRecNo(void);
  640.     virtual Word __fastcall GetRecordSize(void);
  641.     virtual System::Variant __fastcall GetStateFieldValue(Db::TDataSetState State, Db::TField* Field);
  642.     bool __fastcall GetUpdatesPending(void);
  643.     TUpdateRecordTypes __fastcall GetUpdateRecordSet(void);
  644.     PKeyBuffer __fastcall InitKeyBuffer(PKeyBuffer Buffer);
  645.     virtual void __fastcall InitRecord(char * Buffer);
  646.     virtual void __fastcall InternalAddRecord(void * Buffer, bool Append);
  647.     virtual void __fastcall InternalCancel(void);
  648.     virtual void __fastcall InternalClose(void);
  649.     virtual void __fastcall InternalDelete(void);
  650.     virtual void __fastcall InternalEdit(void);
  651.     virtual void __fastcall InternalFirst(void);
  652.     virtual void __fastcall InternalGotoBookmark(void * Bookmark);
  653.     virtual void __fastcall InternalHandleException(void);
  654.     virtual void __fastcall InternalInitFieldDefs(void);
  655.     virtual void __fastcall InternalInitRecord(char * Buffer);
  656.     virtual void __fastcall InternalLast(void);
  657.     virtual void __fastcall InternalOpen(void);
  658.     virtual void __fastcall InternalPost(void);
  659.     virtual void __fastcall InternalRefresh(void);
  660.     virtual void __fastcall InternalSetToRecord(char * Buffer);
  661.     virtual bool __fastcall IsCursorOpen(void);
  662.     bool __fastcall LocateRecord(const System::AnsiString KeyFields, const System::Variant &KeyValues, 
  663.         Db::TLocateOptions Options, bool SyncCursor);
  664.     bool __fastcall MapsToIndex(Classes::TList* Fields, bool CaseInsensitive);
  665.     virtual void __fastcall OpenCursor(bool InfoQuery);
  666.     void __fastcall PostKeyBuffer(bool Commit);
  667.     virtual void __fastcall PrepareCursor(void);
  668.     Word __fastcall ProcessUpdates(Bde::DBIDelayedUpdCmd UpdCmd);
  669.     bool __fastcall ResetCursorRange(void);
  670.     virtual void __fastcall SetBookmarkData(char * Buffer, void * Data);
  671.     virtual void __fastcall SetBookmarkFlag(char * Buffer, Db::TBookmarkFlag Value);
  672.     void __fastcall SetCachedUpdates(bool Value);
  673.     bool __fastcall SetCursorRange(void);
  674.     virtual void __fastcall SetFieldData(Db::TField* Field, void * Buffer);
  675.     void __fastcall SetFilterData(const System::AnsiString Text, Db::TFilterOptions Options);
  676.     void __fastcall SetFilterHandle(Bde::hDBIFilter &Filter, Bde::hDBIFilter Value);
  677.     virtual void __fastcall SetFiltered(bool Value);
  678.     virtual void __fastcall SetFilterOptions(Db::TFilterOptions Value);
  679.     virtual void __fastcall SetFilterText(const System::AnsiString Value);
  680.     void __fastcall SetIndexField(int Index, Db::TField* Value);
  681.     void __fastcall SetKeyBuffer(TKeyIndex KeyIndex, bool Clear);
  682.     void __fastcall SetKeyExclusive(bool Value);
  683.     void __fastcall SetKeyFieldCount(int Value);
  684.     void __fastcall SetKeyFields(TKeyIndex KeyIndex, const System::TVarRec * Values, const int Values_Size
  685.         );
  686.     void __fastcall SetLinkRanges(Classes::TList* MasterFields);
  687.     void __fastcall SetLocale(void * Value);
  688.     virtual void __fastcall SetStateFieldValue(Db::TDataSetState State, Db::TField* Field, const System::Variant 
  689.         &Value);
  690.     virtual void __fastcall SetOnFilterRecord(const Db::TFilterRecordEvent Value);
  691.     void __fastcall SetOnUpdateError(TUpdateErrorEvent UpdateEvent);
  692.     virtual void __fastcall SetRecNo(int Value);
  693.     void __fastcall SetupCallBack(bool Value);
  694.     void __fastcall SetUpdateRecordSet(TUpdateRecordTypes RecordTypes);
  695.     void __fastcall SetUpdateObject(TDataSetUpdateObject* Value);
  696.     void __fastcall SwitchToIndex(const System::AnsiString IndexName, const System::AnsiString TagName)
  697.         ;
  698.     bool __fastcall UpdateCallbackRequired(void);
  699.     Bde::CBRType __fastcall YieldCallBack(void * CBInfo);
  700.     
  701. public:
  702.     __fastcall virtual TBDEDataSet(Classes::TComponent* AOwner);
  703.     __fastcall virtual ~TBDEDataSet(void);
  704.     void __fastcall ApplyUpdates(void);
  705.     virtual bool __fastcall BookmarkValid(void * Bookmark);
  706.     virtual void __fastcall Cancel(void);
  707.     void __fastcall CancelUpdates(void);
  708.     __property bool CacheBlobs = {read=FCacheBlobs, write=FCacheBlobs, default=1};
  709.     virtual int __fastcall CompareBookmarks(void * Bookmark1, void * Bookmark2);
  710.     void __fastcall CommitUpdates(void);
  711.     Word __stdcall ConstraintCallBack(Bde::DsInfoReq Req, Bde::DataSources &ADataSources);
  712.     bool __fastcall ConstraintsDisabled(void);
  713.     virtual Classes::TStream* __fastcall CreateBlobStream(Db::TField* Field, Db::TBlobStreamMode Mode);
  714.         
  715.     void __fastcall DisableConstraints(void);
  716.     void __fastcall EnableConstraints(void);
  717.     void __fastcall FetchAll(void);
  718.     void __fastcall FlushBuffers(void);
  719.     virtual bool __fastcall GetCurrentRecord(char * Buffer);
  720.     void __fastcall GetIndexInfo(void);
  721.     virtual bool __fastcall Locate(const System::AnsiString KeyFields, const System::Variant &KeyValues
  722.         , Db::TLocateOptions Options);
  723.     virtual System::Variant __fastcall Lookup(const System::AnsiString KeyFields, const System::Variant 
  724.         &KeyValues, const System::AnsiString ResultFields);
  725.     virtual bool __fastcall IsSequenced(void);
  726.     virtual void __fastcall Post(void);
  727.     void __fastcall RevertRecord(void);
  728.     Db::TUpdateStatus __fastcall UpdateStatus(void);
  729.     virtual void __fastcall Translate(char * Src, char * Dest, bool ToOem);
  730.     __property bool ExpIndex = {read=FExpIndex, nodefault};
  731.     __property Bde::hDBICur Handle = {read=FHandle};
  732.     __property Word KeySize = {read=FKeySize, nodefault};
  733.     __property void * Locale = {read=FLocale};
  734.     __property TDataSetUpdateObject* UpdateObject = {read=FUpdateObject, write=SetUpdateObject};
  735.     __property bool UpdatesPending = {read=GetUpdatesPending, nodefault};
  736.     __property TUpdateRecordTypes UpdateRecordTypes = {read=GetUpdateRecordSet, write=SetUpdateRecordSet
  737.         , nodefault};
  738.     
  739. __published:
  740.     __property Active ;
  741.     __property AutoCalcFields ;
  742.     __property bool CachedUpdates = {read=FCachedUpdates, write=SetCachedUpdates, default=0};
  743.     __property Filter ;
  744.     __property Filtered ;
  745.     __property FilterOptions ;
  746.     __property BeforeOpen ;
  747.     __property AfterOpen ;
  748.     __property BeforeClose ;
  749.     __property AfterClose ;
  750.     __property BeforeInsert ;
  751.     __property AfterInsert ;
  752.     __property BeforeEdit ;
  753.     __property AfterEdit ;
  754.     __property BeforePost ;
  755.     __property AfterPost ;
  756.     __property BeforeCancel ;
  757.     __property AfterCancel ;
  758.     __property BeforeDelete ;
  759.     __property AfterDelete ;
  760.     __property BeforeScroll ;
  761.     __property AfterScroll ;
  762.     __property OnCalcFields ;
  763.     __property OnDeleteError ;
  764.     __property OnEditError ;
  765.     __property OnFilterRecord ;
  766.     __property OnNewRecord ;
  767.     __property OnPostError ;
  768.     __property TOnServerYieldEvent OnServerYield = {read=FOnServerYield, write=FOnServerYield};
  769.     __property TUpdateErrorEvent OnUpdateError = {read=FOnUpdateError, write=SetOnUpdateError};
  770.     __property TUpdateRecordEvent OnUpdateRecord = {read=FOnUpdateRecord, write=FOnUpdateRecord};
  771. };
  772.  
  773. enum TUpdateMode { upWhereAll, upWhereChanged, upWhereKeyOnly };
  774.  
  775. typedef Set<Shortint, 0, 15>  TDBFlags;
  776.  
  777. class PASCALIMPLEMENTATION TDBDataSet : public Dbtables::TBDEDataSet 
  778. {
  779.     typedef Dbtables::TBDEDataSet inherited;
  780.     
  781. private:
  782.     TDBFlags FDBFlags;
  783.     TUpdateMode FUpdateMode;
  784.     TDatabase* FDatabase;
  785.     System::AnsiString FDatabaseName;
  786.     System::AnsiString FSessionName;
  787.     void __fastcall CheckDBSessionName(void);
  788.     Bde::hDBIDb __fastcall GetDBHandle(void);
  789.     void * __fastcall GetDBLocale(void);
  790.     TSession* __fastcall GetDBSession(void);
  791.     void __fastcall SetDatabaseName(const System::AnsiString Value);
  792.     void __fastcall SetSessionName(const System::AnsiString Value);
  793.     void __fastcall SetUpdateMode(const TUpdateMode Value);
  794.     
  795. protected:
  796.     virtual void __fastcall CloseCursor(void);
  797.     bool __fastcall ConstraintsStored(void);
  798.     virtual void __fastcall Disconnect(void);
  799.     virtual Stdvcl::_di_IProvider __fastcall GetProvider(void);
  800.     virtual void __fastcall OpenCursor(bool InfoQuery);
  801.     virtual bool __fastcall SetDBFlag(int Flag, bool Value);
  802.     __property TDBFlags DBFlags = {read=FDBFlags, nodefault};
  803.     __property TUpdateMode UpdateMode = {read=FUpdateMode, write=SetUpdateMode, default=0};
  804.     
  805. public:
  806.     bool __fastcall CheckOpen(Word Status);
  807.     void __fastcall CloseDatabase(TDatabase* Database);
  808.     TDatabase* __fastcall OpenDatabase(void);
  809.     __property TDatabase* Database = {read=FDatabase};
  810.     __property Bde::hDBIDb DBHandle = {read=GetDBHandle};
  811.     __property void * DBLocale = {read=GetDBLocale};
  812.     __property TSession* DBSession = {read=GetDBSession};
  813.     __property Stdvcl::_di_IProvider Provider = {read=GetProvider};
  814.     
  815. __published:
  816.     __property System::AnsiString DatabaseName = {read=FDatabaseName, write=SetDatabaseName};
  817.     __property System::AnsiString SessionName = {read=FSessionName, write=SetSessionName};
  818. public:
  819.     /* TBDEDataSet.Create */ __fastcall virtual TDBDataSet(Classes::TComponent* AOwner) : Dbtables::TBDEDataSet(
  820.         AOwner) { }
  821.     /* TBDEDataSet.Destroy */ __fastcall virtual ~TDBDataSet(void) { }
  822.     
  823. };
  824.  
  825. enum TBatchMode { batAppend, batUpdate, batAppendUpdate, batDelete, batCopy };
  826.  
  827. enum TTableType { ttDefault, ttParadox, ttDBase, ttFoxPro, ttASCII };
  828.  
  829. enum TLockType { ltReadLock, ltWriteLock };
  830.  
  831. typedef System::AnsiString TIndexName;
  832.  
  833. class DELPHICLASS TIndexFiles;
  834. class DELPHICLASS TTable;
  835. class PASCALIMPLEMENTATION TTable : public Dbtables::TDBDataSet 
  836. {
  837.     typedef Dbtables::TDBDataSet inherited;
  838.     
  839. private:
  840.     bool FStoreDefs;
  841.     Db::TIndexDefs* FIndexDefs;
  842.     Dbcommon::TMasterDataLink* FMasterLink;
  843.     bool FExclusive;
  844.     bool FReadOnly;
  845.     TTableType FTableType;
  846.     bool FFieldsIndex;
  847.     System::AnsiString FTableName;
  848.     System::AnsiString FIndexName;
  849.     Classes::TStrings* FIndexFiles;
  850.     Bde::_hDBIObj *FLookupHandle;
  851.     System::AnsiString FLookupKeyFields;
  852.     int FTableLevel;
  853.     bool FLookupCaseIns;
  854.     void __fastcall CheckMasterRange(void);
  855.     void __fastcall DecodeIndexDesc(const Bde::IDXDesc &IndexDesc, System::AnsiString &Source, System::AnsiString 
  856.         &Name, System::AnsiString &FieldExpression, Db::TIndexOptions &Options);
  857.     bool __fastcall FieldDefsStored(void);
  858.     char * __fastcall GetDriverTypeName(char * Buffer);
  859.     bool __fastcall GetExists(void);
  860.     System::AnsiString __fastcall GetIndexFieldNames(void);
  861.     System::AnsiString __fastcall GetIndexName(void);
  862.     void __fastcall GetIndexParams(const System::AnsiString IndexName, bool FieldsIndex, System::AnsiString 
  863.         &IndexedName, System::AnsiString &IndexTag);
  864.     System::AnsiString __fastcall GetMasterFields(void);
  865.     char * __fastcall GetTableTypeName(void);
  866.     int __fastcall GetTableLevel(void);
  867.     bool __fastcall IndexDefsStored(void);
  868.     bool __fastcall IsXBaseTable(void);
  869.     void __fastcall MasterChanged(System::TObject* Sender);
  870.     void __fastcall MasterDisabled(System::TObject* Sender);
  871.     void __fastcall SetDataSource(Db::TDataSource* Value);
  872.     void __fastcall SetExclusive(bool Value);
  873.     void __fastcall SetIndexDefs(Db::TIndexDefs* Value);
  874.     void __fastcall SetIndex(const System::AnsiString Value, bool FieldsIndex);
  875.     void __fastcall SetIndexFieldNames(const System::AnsiString Value);
  876.     void __fastcall SetIndexFiles(Classes::TStrings* Value);
  877.     void __fastcall SetIndexName(const System::AnsiString Value);
  878.     void __fastcall SetMasterFields(const System::AnsiString Value);
  879.     void __fastcall SetReadOnly(bool Value);
  880.     void __fastcall SetTableLock(TLockType LockType, bool Lock);
  881.     void __fastcall SetTableName(const System::AnsiString Value);
  882.     void __fastcall SetTableType(TTableType Value);
  883.     void * __fastcall SetTempLocale(bool ActiveCheck);
  884.     void __fastcall RestoreLocale(void * LocaleSave);
  885.     void __fastcall UpdateRange(void);
  886.     
  887. protected:
  888.     virtual Bde::hDBICur __fastcall CreateHandle(void);
  889.     virtual void __fastcall DataEvent(Db::TDataEvent Event, int Info);
  890.     virtual void __fastcall DefChanged(System::TObject* Sender);
  891.     virtual void __fastcall DestroyHandle(void);
  892.     virtual void __fastcall DestroyLookupCursor(void);
  893.     virtual void __fastcall DoOnNewRecord(void);
  894.     void __fastcall EncodeFieldDesc(Bde::FLDDesc &FieldDesc, const System::AnsiString Name, Db::TFieldType 
  895.         DataType, Word Size);
  896.     void __fastcall EncodeIndexDesc(Bde::IDXDesc &IndexDesc, const System::AnsiString Name, const System::AnsiString 
  897.         FieldExpression, Db::TIndexOptions Options);
  898.     virtual bool __fastcall GetCanModify(void);
  899.     virtual Db::TDataSource* __fastcall GetDataSource(void);
  900.     Bde::hDBICur __fastcall GetHandle(const System::AnsiString IndexName, const System::AnsiString IndexTag
  901.         );
  902.     System::AnsiString __fastcall GetLanguageDriverName(void);
  903.     virtual Bde::hDBICur __fastcall GetLookupCursor(const System::AnsiString KeyFields, bool CaseInsensitive
  904.         );
  905.     virtual void __fastcall InitFieldDefs(void);
  906.     bool __fastcall IsProductionIndex(const System::AnsiString IndexName);
  907.     System::AnsiString __fastcall GetFileName(void);
  908.     TTableType __fastcall GetTableType(void);
  909.     virtual void __fastcall PrepareCursor(void);
  910.     virtual void __fastcall UpdateIndexDefs(void);
  911.     __property Dbcommon::TMasterDataLink* MasterLink = {read=FMasterLink};
  912.     
  913. public:
  914.     __fastcall virtual TTable(Classes::TComponent* AOwner);
  915.     __fastcall virtual ~TTable(void);
  916.     int __fastcall BatchMove(TBDEDataSet* ASource, TBatchMode AMode);
  917.     void __fastcall AddIndex(const System::AnsiString Name, const System::AnsiString Fields, Db::TIndexOptions 
  918.         Options);
  919.     void __fastcall ApplyRange(void);
  920.     void __fastcall CancelRange(void);
  921.     void __fastcall CloseIndexFile(const System::AnsiString IndexFileName);
  922.     void __fastcall CreateTable(void);
  923.     void __fastcall DeleteIndex(const System::AnsiString Name);
  924.     void __fastcall DeleteTable(void);
  925.     void __fastcall EditKey(void);
  926.     void __fastcall EditRangeEnd(void);
  927.     void __fastcall EditRangeStart(void);
  928.     void __fastcall EmptyTable(void);
  929.     bool __fastcall FindKey(const System::TVarRec * KeyValues, const int KeyValues_Size);
  930.     void __fastcall FindNearest(const System::TVarRec * KeyValues, const int KeyValues_Size);
  931.     void __fastcall GetIndexNames(Classes::TStrings* List);
  932.     void __fastcall GotoCurrent(TTable* Table);
  933.     bool __fastcall GotoKey(void);
  934.     void __fastcall GotoNearest(void);
  935.     void __fastcall LockTable(TLockType LockType);
  936.     void __fastcall OpenIndexFile(const System::AnsiString IndexName);
  937.     void __fastcall RenameTable(const System::AnsiString NewTableName);
  938.     void __fastcall SetKey(void);
  939.     void __fastcall SetRange(const System::TVarRec * StartValues, const int StartValues_Size, const System::TVarRec 
  940.         * EndValues, const int EndValues_Size);
  941.     void __fastcall SetRangeEnd(void);
  942.     void __fastcall SetRangeStart(void);
  943.     void __fastcall UnlockTable(TLockType LockType);
  944.     __property bool Exists = {read=GetExists, nodefault};
  945.     __property int IndexFieldCount = {read=GetIndexFieldCount, nodefault};
  946.     __property Db::TField* IndexFields[int Index] = {read=GetIndexField, write=SetIndexField};
  947.     __property bool KeyExclusive = {read=GetKeyExclusive, write=SetKeyExclusive, nodefault};
  948.     __property int KeyFieldCount = {read=GetKeyFieldCount, write=SetKeyFieldCount, nodefault};
  949.     __property int TableLevel = {read=GetTableLevel, write=FTableLevel, nodefault};
  950.     
  951. __published:
  952.     __property Constraints  = {stored=ConstraintsStored};
  953.     __property bool Exclusive = {read=FExclusive, write=SetExclusive, default=0};
  954.     __property FieldDefs  = {stored=FieldDefsStored};
  955.     __property Db::TIndexDefs* IndexDefs = {read=FIndexDefs, write=SetIndexDefs, stored=IndexDefsStored
  956.         };
  957.     __property System::AnsiString IndexFieldNames = {read=GetIndexFieldNames, write=SetIndexFieldNames}
  958.         ;
  959.     __property Classes::TStrings* IndexFiles = {read=FIndexFiles, write=SetIndexFiles};
  960.     __property System::AnsiString IndexName = {read=GetIndexName, write=SetIndexName};
  961.     __property System::AnsiString MasterFields = {read=GetMasterFields, write=SetMasterFields};
  962.     __property Db::TDataSource* MasterSource = {read=GetDataSource, write=SetDataSource};
  963.     __property bool ReadOnly = {read=FReadOnly, write=SetReadOnly, default=0};
  964.     __property bool StoreDefs = {read=FStoreDefs, write=FStoreDefs, default=0};
  965.     __property System::AnsiString TableName = {read=FTableName, write=SetTableName};
  966.     __property TTableType TableType = {read=FTableType, write=SetTableType, default=0};
  967.     __property UpdateMode ;
  968.     __property UpdateObject ;
  969. };
  970.  
  971. class PASCALIMPLEMENTATION TIndexFiles : public Classes::TStringList 
  972. {
  973.     typedef Classes::TStringList inherited;
  974.     
  975. private:
  976.     TTable* FOwner;
  977.     
  978. public:
  979.     __fastcall TIndexFiles(TTable* AOwner);
  980.     virtual int __fastcall Add(const System::AnsiString S);
  981.     virtual void __fastcall Clear(void);
  982.     virtual void __fastcall Delete(int Index);
  983.     virtual void __fastcall Insert(int Index, const System::AnsiString S);
  984. public:
  985.     /* TStringList.Destroy */ __fastcall virtual ~TIndexFiles(void) { }
  986.     
  987. };
  988.  
  989. class DELPHICLASS TBatchMove;
  990. class PASCALIMPLEMENTATION TBatchMove : public Classes::TComponent 
  991. {
  992.     typedef Classes::TComponent inherited;
  993.     
  994. private:
  995.     TTable* FDestination;
  996.     TBDEDataSet* FSource;
  997.     TBatchMode FMode;
  998.     bool FAbortOnKeyViol;
  999.     bool FAbortOnProblem;
  1000.     bool FTransliterate;
  1001.     int FRecordCount;
  1002.     int FMovedCount;
  1003.     int FKeyViolCount;
  1004.     int FProblemCount;
  1005.     int FChangedCount;
  1006.     Classes::TStrings* FMappings;
  1007.     System::AnsiString FKeyViolTableName;
  1008.     System::AnsiString FProblemTableName;
  1009.     System::AnsiString FChangedTableName;
  1010.     int FCommitCount;
  1011.     char * __fastcall ConvertName(const System::AnsiString Name, char * Buffer);
  1012.     void __fastcall SetMappings(Classes::TStrings* Value);
  1013.     void __fastcall SetSource(TBDEDataSet* Value);
  1014.     
  1015. protected:
  1016.     virtual void __fastcall Notification(Classes::TComponent* AComponent, Classes::TOperation Operation
  1017.         );
  1018.     
  1019. public:
  1020.     __fastcall virtual TBatchMove(Classes::TComponent* AOwner);
  1021.     __fastcall virtual ~TBatchMove(void);
  1022.     void __fastcall Execute(void);
  1023.     __property int ChangedCount = {read=FChangedCount, nodefault};
  1024.     __property int KeyViolCount = {read=FKeyViolCount, nodefault};
  1025.     __property int MovedCount = {read=FMovedCount, nodefault};
  1026.     __property int ProblemCount = {read=FProblemCount, nodefault};
  1027.     
  1028. __published:
  1029.     __property bool AbortOnKeyViol = {read=FAbortOnKeyViol, write=FAbortOnKeyViol, default=1};
  1030.     __property bool AbortOnProblem = {read=FAbortOnProblem, write=FAbortOnProblem, default=1};
  1031.     __property int CommitCount = {read=FCommitCount, write=FCommitCount, default=0};
  1032.     __property System::AnsiString ChangedTableName = {read=FChangedTableName, write=FChangedTableName};
  1033.         
  1034.     __property TTable* Destination = {read=FDestination, write=FDestination};
  1035.     __property System::AnsiString KeyViolTableName = {read=FKeyViolTableName, write=FKeyViolTableName};
  1036.         
  1037.     __property Classes::TStrings* Mappings = {read=FMappings, write=SetMappings};
  1038.     __property TBatchMode Mode = {read=FMode, write=FMode, default=0};
  1039.     __property System::AnsiString ProblemTableName = {read=FProblemTableName, write=FProblemTableName};
  1040.         
  1041.     __property int RecordCount = {read=FRecordCount, write=FRecordCount, default=0};
  1042.     __property TBDEDataSet* Source = {read=FSource, write=SetSource};
  1043.     __property bool Transliterate = {read=FTransliterate, write=FTransliterate, default=1};
  1044. };
  1045.  
  1046. enum TParamType { ptUnknown, ptInput, ptOutput, ptInputOutput, ptResult };
  1047.  
  1048. class DELPHICLASS TParam;
  1049. class DELPHICLASS TParams;
  1050. class PASCALIMPLEMENTATION TParams : public Classes::TPersistent 
  1051. {
  1052.     typedef Classes::TPersistent inherited;
  1053.     
  1054. private:
  1055.     Classes::TList* FItems;
  1056.     TParam* __fastcall GetParam(Word Index);
  1057.     System::Variant __fastcall GetParamValue(const System::AnsiString ParamName);
  1058.     Word __fastcall GetVersion(void);
  1059.     void __fastcall ReadBinaryData(Classes::TStream* Stream);
  1060.     void __fastcall SetParamValue(const System::AnsiString ParamName, const System::Variant &Value);
  1061.     void __fastcall WriteBinaryData(Classes::TStream* Stream);
  1062.     
  1063. protected:
  1064.     virtual void __fastcall AssignTo(Classes::TPersistent* Dest);
  1065.     virtual void __fastcall DefineProperties(Classes::TFiler* Filer);
  1066.     
  1067. public:
  1068.     __fastcall virtual TParams(void);
  1069.     __fastcall virtual ~TParams(void);
  1070.     virtual void __fastcall Assign(Classes::TPersistent* Source);
  1071.     void __fastcall AssignValues(TParams* Value);
  1072.     void __fastcall AddParam(TParam* Value);
  1073.     void __fastcall RemoveParam(TParam* Value);
  1074.     TParam* __fastcall CreateParam(Db::TFieldType FldType, const System::AnsiString ParamName, TParamType 
  1075.         ParamType);
  1076.     int __fastcall Count(void);
  1077.     void __fastcall Clear(void);
  1078.     void __fastcall GetParamList(Classes::TList* List, const System::AnsiString ParamNames);
  1079.     bool __fastcall IsEqual(TParams* Value);
  1080.     TParam* __fastcall ParamByName(const System::AnsiString Value);
  1081.     __property TParam* Items[Word Index] = {read=GetParam/*, default*/};
  1082.     __property System::Variant ParamValues[System::AnsiString ParamName] = {read=GetParamValue, write=SetParamValue
  1083.         };
  1084. };
  1085.  
  1086. class PASCALIMPLEMENTATION TParam : public Classes::TPersistent 
  1087. {
  1088.     typedef Classes::TPersistent inherited;
  1089.     
  1090. private:
  1091.     TParams* FParamList;
  1092.     System::Variant FData;
  1093.     System::AnsiString FNativeStr;
  1094.     System::AnsiString FName;
  1095.     TFieldType FDataType;
  1096.     bool FNull;
  1097.     bool FBound;
  1098.     TParamType FParamType;
  1099.     void __fastcall InitValue(void);
  1100.     
  1101. protected:
  1102.     void __fastcall AssignParam(TParam* Param);
  1103.     virtual void __fastcall AssignTo(Classes::TPersistent* Dest);
  1104.     System::Currency __fastcall GetAsBCD(void);
  1105.     bool __fastcall GetAsBoolean(void);
  1106.     System::TDateTime __fastcall GetAsDateTime(void);
  1107.     double __fastcall GetAsFloat(void);
  1108.     int __fastcall GetAsInteger(void);
  1109.     System::AnsiString __fastcall GetAsMemo(void);
  1110.     System::AnsiString __fastcall GetAsString(void);
  1111.     System::Variant __fastcall GetAsVariant(void);
  1112.     bool __fastcall IsEqual(TParam* Value);
  1113.     int __fastcall RecBufDataSize(void);
  1114.     void __fastcall RecBufGetData(void * Buffer, void * Locale);
  1115.     void __fastcall SetAsBCD(System::Currency Value);
  1116.     void __fastcall SetAsBlob(System::AnsiString Value);
  1117.     void __fastcall SetAsBoolean(bool Value);
  1118.     void __fastcall SetAsCurrency(double Value);
  1119.     void __fastcall SetAsDate(System::TDateTime Value);
  1120.     void __fastcall SetAsDateTime(System::TDateTime Value);
  1121.     void __fastcall SetAsFloat(double Value);
  1122.     void __fastcall SetAsInteger(int Value);
  1123.     void __fastcall SetAsMemo(const System::AnsiString Value);
  1124.     void __fastcall SetAsString(const System::AnsiString Value);
  1125.     void __fastcall SetAsSmallInt(int Value);
  1126.     void __fastcall SetAsTime(System::TDateTime Value);
  1127.     void __fastcall SetAsVariant(const System::Variant &Value);
  1128.     void __fastcall SetAsWord(int Value);
  1129.     void __fastcall SetDataType(Db::TFieldType Value);
  1130.     void __fastcall SetText(const System::AnsiString Value);
  1131.     
  1132. public:
  1133.     __fastcall TParam(TParams* AParamList, TParamType AParamType);
  1134.     __fastcall virtual ~TParam(void);
  1135.     virtual void __fastcall Assign(Classes::TPersistent* Source);
  1136.     void __fastcall AssignField(Db::TField* Field);
  1137.     void __fastcall AssignFieldValue(Db::TField* Field, const System::Variant &Value);
  1138.     void __fastcall Clear(void);
  1139.     void __fastcall GetData(void * Buffer);
  1140.     int __fastcall GetDataSize(void);
  1141.     void __fastcall LoadFromFile(const System::AnsiString FileName, Db::TBlobType BlobType);
  1142.     void __fastcall LoadFromStream(Classes::TStream* Stream, Db::TBlobType BlobType);
  1143.     void __fastcall SetBlobData(void * Buffer, int Size);
  1144.     void __fastcall SetData(void * Buffer);
  1145.     __property System::Currency AsBCD = {read=GetAsBCD, write=SetAsBCD};
  1146.     __property System::AnsiString AsBlob = {read=GetAsString, write=SetAsBlob};
  1147.     __property bool AsBoolean = {read=GetAsBoolean, write=SetAsBoolean, nodefault};
  1148.     __property double AsCurrency = {read=GetAsFloat, write=SetAsCurrency};
  1149.     __property System::TDateTime AsDate = {read=GetAsDateTime, write=SetAsDate};
  1150.     __property System::TDateTime AsDateTime = {read=GetAsDateTime, write=SetAsDateTime};
  1151.     __property double AsFloat = {read=GetAsFloat, write=SetAsFloat};
  1152.     __property int AsInteger = {read=GetAsInteger, write=SetAsInteger, nodefault};
  1153.     __property int AsSmallInt = {read=GetAsInteger, write=SetAsSmallInt, nodefault};
  1154.     __property System::AnsiString AsMemo = {read=GetAsMemo, write=SetAsMemo};
  1155.     __property System::AnsiString AsString = {read=GetAsString, write=SetAsString};
  1156.     __property System::TDateTime AsTime = {read=GetAsDateTime, write=SetAsTime};
  1157.     __property int AsWord = {read=GetAsInteger, write=SetAsWord, nodefault};
  1158.     __property bool Bound = {read=FBound, write=FBound, nodefault};
  1159.     __property Db::TFieldType DataType = {read=FDataType, write=SetDataType, nodefault};
  1160.     __property bool IsNull = {read=FNull, nodefault};
  1161.     __property System::AnsiString Name = {read=FName, write=FName};
  1162.     __property TParamType ParamType = {read=FParamType, write=FParamType, nodefault};
  1163.     __property System::AnsiString Text = {read=GetAsString, write=SetText};
  1164.     __property System::Variant Value = {read=GetAsVariant, write=SetAsVariant};
  1165. };
  1166.  
  1167. struct TServerDesc;
  1168. typedef TServerDesc *PServerDesc;
  1169.  
  1170. #pragma pack(push, 1)
  1171. struct TServerDesc
  1172. {
  1173.     System::SmallString<64>  ParamName;
  1174.     TFieldType BindType;
  1175. } ;
  1176. #pragma pack(pop)
  1177.  
  1178. enum TParamBindMode { pbByName, pbByNumber };
  1179.  
  1180. class DELPHICLASS TStoredProc;
  1181. class PASCALIMPLEMENTATION TStoredProc : public Dbtables::TDBDataSet 
  1182. {
  1183.     typedef Dbtables::TDBDataSet inherited;
  1184.     
  1185. private:
  1186.     Bde::_hDBIObj *FStmtHandle;
  1187.     System::AnsiString FProcName;
  1188.     TParams* FParams;
  1189.     char *FParamDesc;
  1190.     char *FRecordBuffer;
  1191.     Word FOverLoad;
  1192.     bool FPrepared;
  1193.     bool FQueryMode;
  1194.     char *FServerDescs;
  1195.     TParamBindMode FBindMode;
  1196.     void __fastcall BindParams(void);
  1197.     bool __fastcall CheckServerParams(void);
  1198.     Bde::hDBICur __fastcall CreateCursor(bool GenHandle);
  1199.     void __fastcall CreateParamDesc(void);
  1200.     void __fastcall FreeStatement(void);
  1201.     Bde::hDBICur __fastcall GetCursor(bool GenHandle);
  1202.     void __fastcall PrepareProc(void);
  1203.     void __fastcall SetParamsList(TParams* Value);
  1204.     void __fastcall SetServerParams(void);
  1205.     
  1206. protected:
  1207.     virtual Bde::hDBICur __fastcall CreateHandle(void);
  1208.     virtual void __fastcall Disconnect(void);
  1209.     Word __fastcall GetParamsCount(void);
  1210.     virtual bool __fastcall SetDBFlag(int Flag, bool Value);
  1211.     void __fastcall SetOverLoad(Word Value);
  1212.     void __fastcall SetProcName(const System::AnsiString Value);
  1213.     void __fastcall SetPrepared(bool Value);
  1214.     void __fastcall SetPrepare(bool Value);
  1215.     
  1216. public:
  1217.     __fastcall virtual TStoredProc(Classes::TComponent* AOwner);
  1218.     __fastcall virtual ~TStoredProc(void);
  1219.     void __fastcall CopyParams(TParams* Value);
  1220.     bool __fastcall DescriptionsAvailable(void);
  1221.     void __fastcall ExecProc(void);
  1222.     TParam* __fastcall ParamByName(const System::AnsiString Value);
  1223.     void __fastcall Prepare(void);
  1224.     void __fastcall GetResults(void);
  1225.     void __fastcall UnPrepare(void);
  1226.     __property Word ParamCount = {read=GetParamsCount, nodefault};
  1227.     __property Bde::hDBIStmt StmtHandle = {read=FStmtHandle};
  1228.     __property bool Prepared = {read=FPrepared, write=SetPrepare, nodefault};
  1229.     
  1230. __published:
  1231.     __property System::AnsiString StoredProcName = {read=FProcName, write=SetProcName};
  1232.     __property Word Overload = {read=FOverLoad, write=SetOverLoad, default=0};
  1233.     __property TParams* Params = {read=FParams, write=SetParamsList};
  1234.     __property TParamBindMode ParamBindMode = {read=FBindMode, write=FBindMode, default=0};
  1235.     __property UpdateObject ;
  1236. };
  1237.  
  1238. class DELPHICLASS TQuery;
  1239. class PASCALIMPLEMENTATION TQuery : public Dbtables::TDBDataSet 
  1240. {
  1241.     typedef Dbtables::TDBDataSet inherited;
  1242.     
  1243. private:
  1244.     Bde::_hDBIObj *FStmtHandle;
  1245.     Classes::TStrings* FSQL;
  1246.     bool FPrepared;
  1247.     TParams* FParams;
  1248.     System::AnsiString FText;
  1249.     Db::TDataLink* FDataLink;
  1250.     bool FLocal;
  1251.     int FRowsAffected;
  1252.     bool FUniDirectional;
  1253.     bool FRequestLive;
  1254.     char *FSQLBinary;
  1255.     bool FConstrained;
  1256.     bool FParamCheck;
  1257.     bool FCheckRowsAffected;
  1258.     Bde::hDBICur __fastcall CreateCursor(bool GenHandle);
  1259.     void __fastcall CreateParams(TParams* List, const char * Value);
  1260.     virtual void __fastcall DefineProperties(Classes::TFiler* Filer);
  1261.     void __fastcall FreeStatement(void);
  1262.     Bde::hDBICur __fastcall GetQueryCursor(bool GenHandle);
  1263.     void __fastcall GetStatementHandle(char * SQLText);
  1264.     int __fastcall GetRowsAffected(void);
  1265.     void __fastcall PrepareSQL(char * Value);
  1266.     void __fastcall QueryChanged(System::TObject* Sender);
  1267.     void __fastcall ReadBinaryData(Classes::TStream* Stream);
  1268.     void __fastcall RefreshParams(void);
  1269.     void __fastcall SetDataSource(Db::TDataSource* Value);
  1270.     void __fastcall SetQuery(Classes::TStrings* Value);
  1271.     void __fastcall SetParamsList(TParams* Value);
  1272.     void __fastcall SetParams(void);
  1273.     void __fastcall SetParamsFromCursor(void);
  1274.     void __fastcall SetPrepared(bool Value);
  1275.     void __fastcall SetPrepare(bool Value);
  1276.     void __fastcall WriteBinaryData(Classes::TStream* Stream);
  1277.     
  1278. protected:
  1279.     virtual Bde::hDBICur __fastcall CreateHandle(void);
  1280.     virtual void __fastcall Disconnect(void);
  1281.     virtual Db::TDataSource* __fastcall GetDataSource(void);
  1282.     Word __fastcall GetParamsCount(void);
  1283.     virtual bool __fastcall SetDBFlag(int Flag, bool Value);
  1284.     __property Db::TDataLink* DataLink = {read=FDataLink};
  1285.     
  1286. public:
  1287.     __fastcall virtual TQuery(Classes::TComponent* AOwner);
  1288.     __fastcall virtual ~TQuery(void);
  1289.     void __fastcall ExecSQL(void);
  1290.     TParam* __fastcall ParamByName(const System::AnsiString Value);
  1291.     void __fastcall Prepare(void);
  1292.     void __fastcall UnPrepare(void);
  1293.     __property bool Prepared = {read=FPrepared, write=SetPrepare, nodefault};
  1294.     __property Word ParamCount = {read=GetParamsCount, nodefault};
  1295.     __property bool Local = {read=FLocal, nodefault};
  1296.     __property Bde::hDBIStmt StmtHandle = {read=FStmtHandle};
  1297.     __property System::AnsiString Text = {read=FText};
  1298.     __property int RowsAffected = {read=GetRowsAffected, nodefault};
  1299.     __property char * SQLBinary = {read=FSQLBinary, write=FSQLBinary};
  1300.     
  1301. __published:
  1302.     __property bool Constrained = {read=FConstrained, write=FConstrained, default=0};
  1303.     __property Constraints  = {stored=ConstraintsStored};
  1304.     __property Db::TDataSource* DataSource = {read=GetDataSource, write=SetDataSource};
  1305.     __property bool ParamCheck = {read=FParamCheck, write=FParamCheck, default=1};
  1306.     __property bool RequestLive = {read=FRequestLive, write=FRequestLive, default=0};
  1307.     __property Classes::TStrings* SQL = {read=FSQL, write=SetQuery};
  1308.     __property TParams* Params = {read=FParams, write=SetParamsList};
  1309.     __property bool UniDirectional = {read=FUniDirectional, write=FUniDirectional, default=0};
  1310.     __property UpdateMode ;
  1311.     __property UpdateObject ;
  1312. };
  1313.  
  1314. class DELPHICLASS TUpdateSQL;
  1315. class PASCALIMPLEMENTATION TUpdateSQL : public Dbtables::TDataSetUpdateObject 
  1316. {
  1317.     typedef Dbtables::TDataSetUpdateObject inherited;
  1318.     
  1319. private:
  1320.     TBDEDataSet* FDataSet;
  1321.     TQuery* FQueries[3];
  1322.     Classes::TStrings* FSQLText[3];
  1323.     TQuery* __fastcall GetQuery(Db::TUpdateKind UpdateKind);
  1324.     Classes::TStrings* __fastcall GetSQL(Db::TUpdateKind UpdateKind);
  1325.     Classes::TStrings* __fastcall GetSQLIndex(int Index);
  1326.     void __fastcall SetSQL(Db::TUpdateKind UpdateKind, Classes::TStrings* Value);
  1327.     void __fastcall SetSQLIndex(int Index, Classes::TStrings* Value);
  1328.     
  1329. protected:
  1330.     virtual TBDEDataSet* __fastcall GetDataSet(void);
  1331.     virtual void __fastcall SetDataSet(TBDEDataSet* ADataSet);
  1332.     void __fastcall SQLChanged(System::TObject* Sender);
  1333.     
  1334. public:
  1335.     __fastcall virtual TUpdateSQL(Classes::TComponent* AOwner);
  1336.     __fastcall virtual ~TUpdateSQL(void);
  1337.     virtual void __fastcall Apply(Db::TUpdateKind UpdateKind);
  1338.     void __fastcall ExecSQL(Db::TUpdateKind UpdateKind);
  1339.     void __fastcall SetParams(Db::TUpdateKind UpdateKind);
  1340.     __property DataSet ;
  1341.     __property TQuery* Query[Db::TUpdateKind UpdateKind] = {read=GetQuery};
  1342.     __property Classes::TStrings* SQL[Db::TUpdateKind UpdateKind] = {read=GetSQL, write=SetSQL};
  1343.     
  1344. __published:
  1345.     __property Classes::TStrings* ModifySQL = {read=GetSQLIndex, write=SetSQLIndex, index=0};
  1346.     __property Classes::TStrings* InsertSQL = {read=GetSQLIndex, write=SetSQLIndex, index=1};
  1347.     __property Classes::TStrings* DeleteSQL = {read=GetSQLIndex, write=SetSQLIndex, index=2};
  1348. };
  1349.  
  1350. class DELPHICLASS TBlobStream;
  1351. class PASCALIMPLEMENTATION TBlobStream : public Classes::TStream 
  1352. {
  1353.     typedef Classes::TStream inherited;
  1354.     
  1355. private:
  1356.     Db::TBlobField* FField;
  1357.     TBDEDataSet* FDataSet;
  1358.     char *FBuffer;
  1359.     TBlobStreamMode FMode;
  1360.     int FFieldNo;
  1361.     bool FOpened;
  1362.     bool FModified;
  1363.     int FPosition;
  1364.     System::AnsiString FBlobData;
  1365.     bool FCached;
  1366.     int FCacheSize;
  1367.     int __fastcall GetBlobSize(void);
  1368.     
  1369. public:
  1370.     __fastcall TBlobStream(Db::TBlobField* Field, Db::TBlobStreamMode Mode);
  1371.     __fastcall virtual ~TBlobStream(void);
  1372.     virtual int __fastcall Read(void *Buffer, int Count);
  1373.     virtual int __fastcall Write(const void *Buffer, int Count);
  1374.     virtual int __fastcall Seek(int Offset, Word Origin);
  1375.     void __fastcall Truncate(void);
  1376. };
  1377.  
  1378. //-- var, const, procedure ---------------------------------------------------
  1379. #define smTraceBufSize (int)(32774)
  1380. #define dbfOpened (Byte)(0)
  1381. #define dbfPrepared (Byte)(1)
  1382. #define dbfExecSQL (Byte)(2)
  1383. #define dbfTable (Byte)(3)
  1384. #define dbfFieldList (Byte)(4)
  1385. #define dbfIndexList (Byte)(5)
  1386. #define dbfStoredProc (Byte)(6)
  1387. #define dbfExecProc (Byte)(7)
  1388. #define dbfProcDesc (Byte)(8)
  1389. #define dbfDatabase (Byte)(9)
  1390. #define cmVirtual (System::Set<TConfigModes, cfmVirtual, cfmSession> () << cfmVirtual )
  1391. #define cmPersistent (System::Set<TConfigModes, cfmVirtual, cfmSession> () << cfmPersistent )
  1392. #define cmSession (System::Set<TConfigModes, cfmVirtual, cfmSession> () << cfmSession )
  1393. #define cmAll (System::Set<TConfigModes, cfmVirtual, cfmSession> () << cfmVirtual << cfmPersistent << cfmSession \
  1394.     )
  1395. extern PACKAGE TSession* Session;
  1396. extern PACKAGE TSessionList* Sessions;
  1397. extern PACKAGE Stdvcl::_di_IProvider __fastcall (*CreateProviderProc)(TDBDataSet* DataSet);
  1398. extern PACKAGE void __fastcall RegisterBDEInitProc(const TBDEInitProc InitProc);
  1399. extern PACKAGE char * __fastcall AnsiToNative(void * Locale, const System::AnsiString AnsiStr, char * 
  1400.     NativeStr, int MaxLen);
  1401. extern PACKAGE void __fastcall NativeToAnsi(void * Locale, char * NativeStr, System::AnsiString &AnsiStr
  1402.     );
  1403. extern PACKAGE void __fastcall AnsiToNativeBuf(void * Locale, char * Source, char * Dest, int Len);
  1404. extern PACKAGE void __fastcall NativeToAnsiBuf(void * Locale, char * Source, char * Dest, int Len);
  1405. extern PACKAGE int __fastcall NativeCompareStr(void * Locale, const System::AnsiString S1, const System::AnsiString 
  1406.     S2, int Len);
  1407. extern PACKAGE int __fastcall NativeCompareStrBuf(void * Locale, const char * S1, const char * S2, int 
  1408.     Len);
  1409. extern PACKAGE int __fastcall NativeCompareText(void * Locale, const System::AnsiString S1, const System::AnsiString 
  1410.     S2, int Len);
  1411. extern PACKAGE int __fastcall NativeCompareTextBuf(void * Locale, const char * S1, const char * S2, 
  1412.     int Len);
  1413. extern PACKAGE void __fastcall DbiError(Word ErrorCode);
  1414. extern PACKAGE void __fastcall Check(Word Status);
  1415.  
  1416. }    /* namespace Dbtables */
  1417. #if !defined(NO_IMPLICIT_NAMESPACE_USE)
  1418. using namespace Dbtables;
  1419. #endif
  1420. //-- end unit ----------------------------------------------------------------
  1421. #endif    // DBTables
  1422.